package com.yuyou.tas.lesson.service;


import com.yuyou.tas.service.api.lesson.dto.DtoBaseTerm;
import com.yuyou.tas.service.api.lesson.entity.BaseTrimester;
import com.yuyou.tas.util.bean.LoginRedisObj;
import com.yuyou.tas.util.bean.Pagination;
import com.yuyou.tas.util.bean.ResBoolSimpleInfo;

import java.util.List;

public interface IBaseTermService {

    int deleteByPrimaryKey(Long id);
    int insert(BaseTrimester record);
    BaseTrimester selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(BaseTrimester record);
	
    ResBoolSimpleInfo addTerm(String name, Integer sort, Integer isTan,Long pId, LoginRedisObj user,Long organId);
    ResBoolSimpleInfo updateTerm(String name, Integer sort, Integer isTan,Long pId, Long id);
    ResBoolSimpleInfo delTerm(Long id);
    ResBoolSimpleInfo<BaseTrimester> getTermByID(Long id);

    int findTermCount(Pagination<DtoBaseTerm> queryPgn);
    List<DtoBaseTerm> findTermPageList(Pagination<DtoBaseTerm> queryPgn);

    int findUserTermCount(Pagination<DtoBaseTerm> queryPgn);
    List<DtoBaseTerm> findUserTermPageList(Pagination<DtoBaseTerm> queryPgn);

    BaseTrimester selectByPKandOrgan(Long id, Long authOrganizationId);
    BaseTrimester selectByCode7Organ(String code,Long authOrganizationId);

    BaseTrimester findById(Long id);
    
    ResBoolSimpleInfo<String> syncTrimester(List<BaseTrimester> list );
    
    BaseTrimester selectByOrgan7OId(Long oId,Long authOrganizationId);
    
    int delByOrgan7OId(Long oId, Long authOrganizationId);
    
    ResBoolSimpleInfo<String> delTrimesterByOrgan7OIds(List<Long> oIds,Long authOrganizationId);
    
    /**
     * 根据机构主键查找所有学期
     * @param authOrganizationId
     * @return
     */
    List<BaseTrimester> findTrimByOran(Long authOrganizationId);


    ResBoolSimpleInfo updateTermStatus(Long id , Integer status);
    
}